//
//  PlaceholderText.swift
//  NyamanDana
//
//  Created by 李永彬 on 2025/10/31.
//

import SwiftUI

struct PlaceholderText: View {
    let text: String
    let placeholder: String
    
    var body: some View {
        ZStack(alignment: .leading) {
            Text(placeholder)
                .foregroundColor(Color(hex: "#C7C7CD"))
                .opacity(text.isEmpty ? 1 : 0)
                .padding(.leading, 5)
                .padding(.trailing, 20)
            
            Text(text)
                .padding(.leading, 5)
                .padding(.trailing, 20)
        }
        .frame(maxWidth: .infinity, alignment: .leading)
    }
}
